#ifndef __TOOLSLISTMODEL_H_
#define __TOOLSLISTMODEL_H_

#include <QStandardItemModel>
#include "painttool.h"
#include "QList"

class ToolsListModel : public QStandardItemModel
{
Q_OBJECT
public:
    ToolsListModel(QObject *parent = 0) : QStandardItemModel(0, 1, parent)
    {
        toolList = new QList<PaintTool *>();
    }

    ~ToolsListModel()
    {
        delete toolList;
    }

    void addTool(PaintTool *tool);

    int toolsCount()
    {
        if(toolList)
        {
            return toolList->count();
        }

        return 0;
    }

    PaintTool* selectedTool(int row)
    {
        if(row >=0 && row < toolsCount())
        {
            return toolList->at(row);
        }

        return 0;
    }

private:
    QList<PaintTool *> *toolList;
};

#endif
